package org.example.bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.Ordered;

/**
 * @version: java version 23
 * @Author: 韩学新
 * @description:
 * @date: 2025-05-13 下午3:41
 */
public class MyBeanPostProcessor1 implements BeanPostProcessor, Ordered {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("MyBeanPostProcessor1 在bean 初始化方法之前执行");
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("MyBeanPostProcessor1 在bean 初始化方法之后执行");
        return bean;
    }

    @Override
    public int getOrder() {
        return 0;
    }
}
